package org.xserver.component.handler.ext;

import org.xserver.component.core.XServerHttpContextAttachment;

/**
 * Write handler will write response to client, subclass decided how to write
 * and whether need to close the channel after write complete.
 * 
 * @author wangj
 */
public interface WriteHandler {

	/**
	 * 
	 * @param attachment
	 *            the request context
	 * @param obj
	 *            the response content
	 */
	public abstract void writeResponse(XServerHttpContextAttachment attachment,
			Object obj) throws Exception;

	public abstract String getResponseType(
			XServerHttpContextAttachment attachment);
}
